<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>专业编辑</title>
	<%
    	String path = request.getContextPath();
	    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
    %>
	<c:set var="path" value="<%=basePath %>"></c:set>
 	<link href="${path }/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
 	<link href="${path }/css/form-public.css" rel="stylesheet" />
 	<link rel="stylesheet" type="text/css" href="${path }/js/zeroModal/zeroModal.css" />
 	<link rel="stylesheet" href="./layui/css/layui.css"  media="all">
</head>
<body>
<form class="layui-form layui-form-pane" id="formDemo" action="updateSpe" method="post">

  <input type="hidden" id="hiddenId" name="hiddenId" value=""/>
  <div style="padding-top: 50px;padding-left: 300px">
  	  <div style="margin-left: 150px;padding-bottom: 10px;color:blue">
  	  	<h2>修改专业</h2>
  	  </div>
  	  <div class="layui-form-item">
	    <label class="layui-form-label">专业名称</label>
	    <div class="layui-input-block">
	      <input type="text" style="width: 250px" id="specialty_name" name="specialty_name" autocomplete="off" placeholder="请输入专业名称" lay-verify="required" class="layui-input">
	    </div>
	  </div>
	  <div class="layui-form-item">
	    <label class="layui-form-label">状态</label>
	    <div class="layui-input-block">
	      <input type="radio" name="state" id="state" value="1" title="禁用" checked="checked"/>
	      <input type="radio" name="state" id="state" value="0" title="启用"/>
	    </div>
	  </div>
	  <div class="layui-form-item">
	    <div class="layui-input-block">
	      <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
	      <button type="reset" onclick="goclass()" class="layui-btn layui-btn-primary">返回</button>
	    </div>
	  </div>
  </div>
</form>

<script type="text/javascript" src="./js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="./js/jqueryui/jquery-ui.js"></script>
<script src="./layui/layui.js" charset="utf-8"></script>    
	
<script>
/* $(function(){
	gettecher();
}); */
function goclass(){
	
}
layui.use(['form', 'layedit', 'laydate'], function(){
	var form = layui.form;
	getSpe(form);
});
function getSpe(form){
	$.ajax({
		url:'getSpe',
		datatype:'json',
		success:function(data){
			$("#specialty_name").val(data.spe.specialty_name);
			radios=document.getElementsByName("state");
			 if(data.spe.specialty_state==0){
				 radios[1].checked=false;
				 radios[0].checked=true;
			}else{
				radios[0].checked=false;
				radios[1].checked=true;
			} 
			$("#hiddenId").val(data.spe.specialty_id);
			form.render();
		} 
	});
}
</script>
</body>
</html>